home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Genius of Edison
/
The Genius of Edison (Version 1.0)(Softkey Multimedia)(GOE744AE-CD)(1996).ISO
/
pc
/
data
/
shared.cst
/
00039_Script_BACK LIST
< prev
next >
Wrap
Text File
|
1996-09-03
|
5KB
|
174 lines
-- --------------------------------------------------------
-- Handler addCurrentSectionToBackList adds the given sectionName to
-- a list of visited sections to be used by the back button.
on addCurrentSectionToBackList
global backList, backFlag, currentSection, currentSubSection
-- note: the first time this is called, it will be sent a void
-- parameter. only add nonVoid values.
-- note: only add the sceneName to the list if:
-- 1) the back button was not clicked (to prevent going back and forth
-- between two sections by clicking numerous times on the
-- back button)
-- 2) the current section is not already at the end of the back list
-- (to prevent them from clicking one section numerous times on the
-- menu and then going back to the same section numerous times).
if not(backFlag) and (LastBackListSection() <> [currentSection, currentSubSection]) and not(voidP(backList)) then
add(backList, list(currentSection, currentSubSection))
end if
end
-- --------------------------------------------------------
-- Handler lastBackListSection returns the section part of
-- the last item in the backList.
on LastBackListSection
global backList
if voidP(backList) then
return EMPTY
else
return getLast(backList)
end if
end
-- --------------------------------------------------------
-- Handler doClickBack goes to the last section visited.
on doClickBack
global backList , fingerCursor
-- global backPressedAlready
-- if not backPressedAlready then
-- ensure that we do not enter this body of code until 'back' movie is loaded
-- set backPressedAlready = 1
set numScenes = count(backList)
if (numScenes) then -- backList is not empty
-- set the cursor to watchCursor this way because
-- the other way (calling the watchCursor handler) is
-- not working write
set the cursor of sprite the clickOn = 4
--set the cursor of sprite the clickOn = fingerCursor
set lastScene = getAt(backList,numScenes)
deleteAt(backList,numScenes) -- remove from list
setBackFlag(TRUE)
goBack(lastScene)
end if
-- end if
end
-- --------------------------------------------------------
-- Handler setBackFlag sets the global variable backFlag to
-- the given value. This is used in maintaining the global
-- variable backList.
on setBackFlag val
global backFlag
set backFlag = val
end
-- --------------------------------------------------------
-- Handler checkBackRoll sets the cursor to a finger cursor
-- if the user rolled over the back part of the menu bar.
on checkBackRoll mousePoint
global backRect, fingerCursor , backCoverUpSprite
if inside(mousePoint, backRect) then
cursor fingerCursor
else
cursor -1
end if
end
-- --------------------------------------------------------
-- Handler goBack goes to the beginning of the given scene
on goBack whichPlace
global menuBarSprite
-- global backPressedAlready
set lastSection = getAt(whichPlace, 1)
set lastSubSection = getAt(whichPlace, 2)
if (lastSection = "wheel") then
goWheel
else if (lastSection = "database") then
goDatabase
else if (lastSection = "timeline") then
goTimeLine
else if (lastSection = "index") then
goIndex
else if (lastSection = "help") then
goHelp
else if (lastSection = "tour") then
goTour
else if (lastSection = "quiz") then
goQuiz
else if isInventionName(lastSection) then
setInventionSectionInfo(lastSection)
if (lastSubSection = "Toms Technology") then
goTomsTechnology
else if (lastSubSection = "Daily Edisonian") then
goDailyEdisonian
else if (lastSubSection = "Time Marches On") then
goTimeMarchesOn
else if (lastSubSection = "Kinetoscope") then
goKinetoscope
else if (lastSubSection = "Kinetograph") then
goKinetograph
else if (lastSubSection = "Morse") then
goMorse
end if
end if
-- set backPressedAlready = 0
set the cursor of sprite menuBarSprite = 0
end
-- --------------------------------------------------------
-- Handler isInventionName returns TRUE if the given term
-- is an invention and FALSE otherwise.
on isInventionName term
global inventionData
return (BinSearchFirstItemInLine(inventionData, term, ",") <> 0)
end
-- --------------------------------------------------------
-- Handler setCurrentSection sets the global variable
-- currentSection to the given value (a variable used in maintaing
-- the backlist).
on setCurrentSection which
global currentSection
set currentSection = which
end
on initializeCurrentSection
global currentSection
-- because for now, ie is also done in the database and help,
-- check if it is void - that means it is coming from the wheel
-- for the first time.
if voidP(currentSection) then
setCurrentSection("wheel")
end if
end
-- --------------------------------------------------------
-- Handler setCurrentSubSection sets the global variable
-- currentSubSection to the given value (a variable used in maintaing
-- the backlist).
on setCurrentSubSection which
global currentSubSection
set currentSubSection = which
end